The invention relates to an arrangement and a method for restricting word length in equipment where digital signal is processed in word form.
Signal is frequently processed as words of a given length in digital equipment. Various operations are performed for digital words, such as correlation and summing, where the word length of a digital word, as a result of an operation, exceeds the word length of the original word. If several such operations occur consecutively, the word length becomes considerably longer than the original word.
In digital equipment words are stored in memories, and the longer the words that are being processed the greater the need for memory capacity. However, it is preferable in equipment particularly intended for portable use that the amount of memory needed can be reduced, as large memories increase the current consumption and price of the equipment and slow down the operation of the equipment. Consequently, the word length is restricted in such situations.
This problem has been encountered, for example, in the receivers used in digital radio networks. Digital word lengths may increase in the receivers, when the received digitized signal is processed. When an analogue signal is conveyed to an A/D converter on the radio path, a 7-bit word is, for example, obtained from the output of the converter. When this word is conveyed from a CDMA receiver to correlators, a 15 to18-bit word is obtained from the output of the correlators. The memory space required by said word is approximately double compared with the original.
A basically simple method that restricts word length is word cut. A digital word can be cut from a particular point. This takes place by forming a quantization window, the length of which equals the length of the desired shorter word, and is thus shorter than the long word to be shortened. The bits remaining outside said quantization window are rejected and the bits inside the window form a new, shorter word.
If the position of the quantization window is fixed, the solution is easy to implement, but then there is a risk that overflow may occur, meaning that significant bits may remain outside the quantization window.
FIGS. 1a-1c illustrate the problem with the fixed window. FIG. 1a shows a long word 100 which comprises 12 bits in this example. The idea is to shorten the word into a word comprising eight bits using a quantization window 102. Overflow of the most significant bits 104 outside the window 102 does not occur in FIG. 1a. In the situation shown in FIG. 1b saturation takes place, when the most significant bit remains outside the window. Saturation is one way of dealing with overflow. When overflow occurs, the largest possible value that can be shown with the word bits is selected as the value of the word. FIG. 1c, in turn, shows how rounding occurs, when the least significant bit 106 remains outside the window.
In prior art solutions the position of the quantization window has been adjusted. This has been implemented on the basis of signal power or strength, but such solutions are difficult to implement as they require complex calculation operations.
It is an object of the invention to provide a method and equipment implementing the method so that the word length can be easily restricted. This is achieved with the method for restricting word length comprising the steps of processing digital signal as words of a given length, forming a quantization window to a word, the quantization window being determined to be shorter than the word length, and shortening the word length of the signal by cutting the bits remaining outside the quantization window from the word. The method of the invention also determines the amount of saturation that the shortening of the word length causes, and adjusts the position of the quantization window in the word to be shortened as a function of saturation.
The invention also relates to an arrangement for changing the word length of a digital mode signal comprising means for forming a quantization window to a word, the quantization window being determined to be shorter than the word length, means for shortening the word length by cutting the bits remaining outside the quantization window from the word. The arrangement of the invention further comprises means for determining the amount of saturation caused by the shortening of the word length, and means for adjusting the position of the quantization window in a word to be shortened as a function of saturation.
The preferred embodiments of the invention are disclosed in the dependent claims.
Several advantages are achieved with the method and arrangement of the invention. The solution of the invention is very simple to implement. One counter is needed for calculating the amount of saturation, and one or more shift registers are needed for shifting the window; both being simple and inexpensive components. The other parts can be implemented by software using a simple control program.